import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Stack;

public class Work1 {

    public static Long func(Long[] array, int n) {
        PriorityQueue<Long> maxHeap = new PriorityQueue<>(new Comparator<Long>() {
            @Override
            public int compare(Long o1, Long o2) {
                int cmp = o1.compareTo(o2);
                if (cmp == 0) {
                    // 如果元素相等，按照插入顺序排序
                    return 1; // 或者 return -1; 可以根据需要选择升序或降序
                }
                return cmp;
            }
        });
        for (int i = 0; i < n; i++) {
            maxHeap.offer(array[i]);
        }
        for (int i = n; i < array.length; i++) {
            if (array[i] > maxHeap.peek()) {
                maxHeap.poll();
                maxHeap.offer(array[i]);
            }
        }
        Stack<Long> ret = new Stack<>();
        for (int i = 0; i < n; i++) {
            ret.push(maxHeap.poll());
        }
        Long num = 0L;
        while (!ret.isEmpty()) {
            ret.pop();
            if (!ret.isEmpty()) {
                num += ret.pop();
            }
        }
        return num;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int length = 3 * n;
        Long[] array = new Long[length];
        for (int i = 0; i < array.length; i++) {
            array[i] = scanner.nextLong();
        }
        //降序排列
        System.out.println(func(array, 2 * n));
    }

}
